#include <cstdio>

int main( )
{
    int n, m, t, cas = 1;
    scanf("%d", &t);
    while ( t-- )
    {
        scanf("%d%d", &n, &m);
        printf("Case #%d: %.8lf\n", cas++, 1.0 / ( n * m + m + 1 ));
    }
    return 0;
}
